Lego Sherlock Holmes figure focuses a light beam on a Lego criminal with a small magnifying glass.

Reading Analog Voltage

A schematic shows how to connect the wires of the EV3 connector.

The EV3 Intelligent Brick can be made to read analog voltages between 0 to 5-volts, proving useful for working with various analog sensors (see posts on Flammable Gas Sensor and Force Sensor, as examples). The schematic above shows how to wire the EV3 cable for sampling analog voltage--see the post on Breakout Board for implementing this connection. As pictured in the graph below, the EV3 reads the input voltage in units of counts from 0 to 4096 counts (4096 is a power of two, corresponding to sampling with 12 bits). Reading the analog voltage input is accomplished with software based on the Raw Sensor Value block in the EV3 programming environment. An example program is given at the bottom of the page.

A graph allows conversion between counts and volts.


EV3 program based on Raw Sensor Value block.